package com.cch.android.activity.vf;


import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.cch.android.activity.ImageLocalActivity;
import com.cch.android.activity.ImageMainActivity;
import com.cch.android.activity.R;
import com.cch.android.activity.ShowHelpActivity;
import com.cch.android.util.MyLog;

public class ImageView extends AbstractView implements OnClickListener{

	private Button openButton;
	private Button explainButton;
	public ImageView(ImageMainActivity va) {
		super(va);
	}

	public View makeNewView() {
		View view = View.inflate(context, R.layout.local_image, null);
		openButton = (Button) view.findViewById(R.id.local_image_button_1);
		explainButton = (Button) view.findViewById(R.id.local_image_button_2);
		openButton.setOnClickListener(this);
		explainButton.setOnClickListener(this);
		return view;
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent();
		switch (v.getId()) {
		case R.id.local_image_button_1:
			MyLog.log("点击打开图片");
			intent.setClass(context, ImageLocalActivity.class);
			context.startActivity(intent);
			break;
		case R.id.local_image_button_2:
			MyLog.log("点击打开图片");
			intent.setClass(context, ShowHelpActivity.class);
			context.startActivity(intent);
			break;
		}
	}
}
